import {RouteConfig} from "vue-router";
import MContent from "@/components/MContent.vue";
import MMain from "@/components/MMain.vue";

export default [
    {
        path: "/",
        component: MMain,
        meta: {
            title: "首页",
            isShow: 1,
        },
        children: [
            {
                path: "",
                component: MContent,
                meta: {
                    title: "我的店铺",
                },
                children: [
                    {
                        path: process.env.VUE_APP_PUBLICPATH,
                        name: "shops",
                        component: () =>
                            import("@/views/shops/Index.vue"),
                    },
                ],
            },
            {
                path: "",
                component: MContent,
                meta: {
                    title: "创建店铺",
                },
                children: [
                    {
                        path: process.env.VUE_APP_PUBLICPATH + "/create",
                        name: "create",
                        component: () =>
                            import("@/views/shops/Create.vue"),
                    },
                ],
            },
        ],
    },
    {
        path: process.env.VUE_APP_PUBLICPATH + "/business",
        component: MMain,
        meta: {
            title: "账号",
            isShow: 1,
        },
        children: [
            {
                path: "",
                component: MContent,
                meta: {
                    title: "账号管理",
                },
                children: [
                    {
                        path: "",
                        name: "businessCenter",
                        component: () =>
                            import("@/views/businessCenter/Index.vue"),
                    },
                ],
            },
        ],
    },
    {
        path: process.env.VUE_APP_PUBLICPATH + "/meal",
        component: MMain,
        meta: {
            title: "套餐",
            isShow: 1,
        },
        children: [
            {
                path: "",
                component: MContent,
                meta: {
                    title: "套餐订购",
                },
                children: [
                    {
                        path: "",
                        name: "order",
                        component: () =>
                            import("@/views/meal/Order/Order.vue"),
                    },
                ],
            },
            {
                path: "update",
                component: MContent,
                meta: {
                    title: "升级/续费",
                },
                children: [
                    {
                        path: "",
                        name: "mealUpdate",
                        component: () =>
                            import("@/views/meal/Update/Update.vue"),
                    },
                ],
            },
        ],
    },
    {
        path: "/login",
        name: "sign",
        component: () =>
            import("@/views/sign/Index.vue"),
        meta: {
            title: "登录",
            isShow: 1,
        },
    },
    {
        path: process.env.VUE_APP_PUBLICPATH + "/changepass",
        name: "changePass",
        component: () =>
            import("@/views/businessCenter/Account/ChangePassword.vue"),
        meta: {
            title: "修改密码",
            isShow: 1,
        },
    },
    {
        path: process.env.VUE_APP_PUBLICPATH + "/protocol",
        name: "protocol",
        component: () =>
            import("@/views/static/Protocol.vue"),
        meta: {
            title: "注册协议",
            isShow: 1,
        },
    },
    {
        path: process.env.VUE_APP_PUBLICPATH + "/privacy",
        name: "privacy",
        component: () =>
            import("@/views/static/Privacy.vue"),
        meta: {
            title: "隐私政策",
            isShow: 1,
        },
    },
    {
        path: process.env.VUE_APP_PUBLICPATH + "/order",
        name: "order",
        component: () =>
            import("@/views/static/Order.vue"),
        meta: {
            title: "订购及服务协议",
            isShow: 1,
        },
    },
    {
        path: process.env.VUE_APP_PUBLICPATH + "/register",
        name: "register",
        component: () =>
            import("@/views/static/Register.vue"),
        meta: {
            title: "开户及服务协议",
            isShow: 1,
        },
    },
    {
        path: process.env.VUE_APP_PUBLICPATH + "/redirect/:type",
        name: "redirect",
        component: () => import("@/views/sign/Redirect.vue"),
        meta: {
            title: "重定向页面",
            isShow: 1,
        },
    },
    {
        path: "*",
        name: "404",
        component: () =>
            import("@/views/sign/404.vue"),
        meta: {
            title: "404",
            isShow: 1,
        },
    },
] as RouteConfig[];
